package com.jeff.tianti.controller;

import com.jeff.tianti.cms.entity.Prize;
import com.jeff.tianti.cms.service.PrizeService;
import com.jeff.tianti.common.PageBean;
import com.jeff.tianti.common.dto.AjaxResult;
import com.jeff.tianti.common.entity.PageModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


@RestController
@RequestMapping("/prize")
@CrossOrigin(maxAge = 3600)
public class PrizeController {

    @Autowired
    PrizeService prizeService;

    @RequestMapping(value = "/list", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public AjaxResult getPrizeList(@RequestBody PageBean pageBean) {
        PageModel<Map<String, Object>> prizePage = prizeService.queryPrizeList(pageBean);
        return AjaxResult.setSuccessPageModelDate(prizePage);
    }


}
